# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=py3-pylibmc
pkgver=1.6.3
pkgrel=0
pkgdesc="Python wrapper around the libmemcached interface from TangentOrg"
url="https://sendapatch.se/projects/pylibmc/"
arch="all"
license="BSD-3-Clause"
makedepends="
	libmemcached-dev
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	zlib-dev
	"
checkdepends="
	memcached
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="https://github.com/lericson/pylibmc/archive/refs/tags/$pkgver/py3-pylibmc-$pkgver.tar.gz"
builddir="$srcdir/pylibmc-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	local ret=0
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl

	memcached &
	.testenv/bin/python3 -m pytest || ret=1
	kill %%
	return $ret
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
4bc85d305410f775a39d8d3f64a7e97538ed6ae890cd64833e5bff92fbb60fe8ebc4cc7956df015f6590eb55b7009bd36b299dc636ee0da7f71ed51cc98f3012  py3-pylibmc-1.6.3.tar.gz
"
